-
Notifications
You must be signed in to change notification settings - Fork 288
Conversation
@@ -462,6 +462,8 @@ namespace internal { | |||
return eosio::key_type{(char*)buffer, actual_value_size}; | |||
} | |||
|
|||
bool valid() const { return itr_stat != status::iterator_erased; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be itr_stat == status::iterator_ok
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the iterator end() be true or false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
itr_stat == status::iterator_ok
?
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False. You can't materialize the value from either erased or end.
So the use case for this is:
auto itr = find some value
if (itr)
do something with the value
else
create an entry for the key and value
Since CI fixes are required for buildkite build, I created a new PR: #997 |
Change Description
Added bool operator to KV table iterator so that developers can easily check if the iterator exists by using an
if (itr) {}
statement.Change Type
Select ONE
Consensus Changes
API Changes
Documentation Additions